Skip to content

Fix test mode: skip interactive prompts and add MockLLMAPI#35

Merged
joone merged 4 commits intomainfrom
copilot/fix-linux-command-test-error
Feb 16, 2026
Merged

Fix test mode: skip interactive prompts and add MockLLMAPI#35
joone merged 4 commits intomainfrom
copilot/fix-linux-command-test-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 16, 2026

Test "Handle no output" failed because config initialization prompted for LLM service selection in MOCHA_ENV=test mode, blocking execution.

Changes

Config initialization (src/config/index.ts)

  • Detect MOCHA_ENV=test and skip interactive prompts
  • Auto-configure: use OpenAI if OPENAI_API_KEY present, otherwise MockLLMAPI

MockLLMAPI (src/llm/index.ts)

  • New mock LLM service with predefined command mappings for test prompts
  • Eliminates external LLM dependencies in tests
if (userPrompt.includes("Find sfsdfef")) {
  return '{ "commands": ["grep \'sfsdfef\' *"] }';
} else if (userPrompt.includes("current date and time")) {
  return '{ "commands": ["date"] }';
}

LLM initialization (src/loz.ts)

  • Handle api === "mock" case
  • Skip ollama version check in test mode

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 16, 2026 20:36
Co-authored-by: joone <1979160+joone@users.noreply.github.com>
Co-authored-by: joone <1979160+joone@users.noreply.github.com>
Co-authored-by: joone <1979160+joone@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test error in Linux command handling Fix test mode: skip interactive prompts and add MockLLMAPI Feb 16, 2026
Copilot AI requested a review from joone February 16, 2026 20:40
Copilot AI requested a review from joone February 16, 2026 20:50
@joone joone marked this pull request as ready for review February 16, 2026 20:50
@joone joone merged commit df0f087 into main Feb 16, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants